Email from console or via bash script

Sometimes required to send email from console or from bash script. And here I will provide few use-cases… mail – simple email: echo “BODY MESSAGE” | mail -s “Subject” rcpt@some-domain.com mail – with attachment: echo “BODY MESSAGE” | mail -s “Subject” -a attachmet.txt rcpt@some-domain.com sendmail – simple email: sendmail email@some-domain.com <<EOF Subject: Test Subject From: … Continue reading Email from console or via bash script